package com.tiantong.aibilian.config;

import android.app.Activity;
import android.os.Environment;

import com.tiantong.aibilian.MainActivity;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class API {


    public static String Socket_URL="http://43.139.124.244:3000";


    /**
     * 不追加文件
     * @param filename   文件名称
     * @param content  打印内容
     */
    public static void writeContent(Activity mainActivity, String filename, String content) {
        String path = mainActivity.getExternalFilesDir(null).getPath()+filename; //文件路径
        FileOutputStream fos =null;
        try {
            fos = new FileOutputStream(path);
            fos.write(content.getBytes());  //写入文件
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                fos.close();  //关闭文件流
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }


}
